<template>
  <div class="comPage">
    <el-form :inline="true" :model="formInline" class="formALL" :size="formSize" label-position="right"
      label-width="auto">
      <el-row>
        <el-col :span="24">
          <el-form-item label="执业证书编码： ">
            <el-input v-model="text" style="width: 300px" maxlength="50" placeholder="请输入资格证书编码" show-word-limit
              type="text" />
          </el-form-item>
        </el-col>

        <el-col :span="24">
          <el-form-item label="执业证书发证日期：">
            <el-input v-model="text" style="width: 300px" maxlength="50" placeholder="请输入第一执业机构编码" show-word-limit
              type="text" />
          </el-form-item>
        </el-col>

        <el-col :span="24">
          <el-form-item label="第一执业机构名称：">
            <el-input v-model="text" style="width: 300px" maxlength="50" placeholder="请输入第一执业机构名称" show-word-limit
              type="text" />
          </el-form-item>
        </el-col>

        <el-col :span="24">
          <el-form-item label="执业证书：">
            <el-upload class="avatar-uploader" action="https://jsonplaceholder.typicode.com/posts/"
              :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
              <img v-if="formInline.imageUrl" :src="formInline.imageUrl" class="avatar">
              <div class="upLoadImg">
                <img class="addImg" src="/src/assets/addIm g.png" alt="">
                <div class="title">上传图片</div>
              </div>
            </el-upload>
            <img class="tipImg" src="https://backend_alpha.xiaoliuyisheng.com/static/img/example.5b079de0.png" alt="">
          </el-form-item>
        </el-col>

        <el-col :span="24">
          <el-form-item label="资格证书：">
            <el-upload class="avatar-uploader" action="https://jsonplaceholder.typicode.com/posts/"
              :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
              <img v-if="formInline.imageUrl" :src="formInline.imageUrl" class="avatar">
              <div class="upLoadImg">
                <img class="addImg" src="/src/assets/addIm g.png" alt="">
                <div class="title">上传图片</div>
              </div>
            </el-upload>
            <img class="tipImg" src="https://backend_alpha.xiaoliuyisheng.com/static/img/example.5b079de0.png" alt="">
          </el-form-item>
        </el-col>

        <el-col :span="24">
          <el-form-item label="职称证书：">
            <el-upload class="avatar-uploader" action="https://jsonplaceholder.typicode.com/posts/"
              :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
              <img v-if="formInline.imageUrl" :src="formInline.imageUrl" class="avatar">
              <div class="upLoadImg">
                <img class="addImg" src="/src/assets/addIm g.png" alt="">
                <div class="title">上传图片</div>
              </div>
            </el-upload>
            <img class="tipImg" src="https://backend_alpha.xiaoliuyisheng.com/static/img/example.5b079de0.png" alt="">
          </el-form-item>
        </el-col>
      </el-row>

    </el-form>
  </div>
</template>
<script>
  import {
    ref,
    reactive,
    toRaw
  } from 'vue'
  export default {
    name: 'FileUpload',
    setup() {
      // 获取实例的引用，用于调用upload1.submit进行手动上传
      const formInline = reactive({
        text1: '0'
      })
      const formSize = ref('default')
      const imageUrl = ref('')


      return {
        formInline,
        formSize,
        imageUrl
      }
    },
  }
</script>

<style lang="scss" scoped>
  ::v-deep .el-input {
    width: 400px;
    height: 40px;
  }

  ::v-deep .el-select {
    width: 400px;

  }

  ::v-deep .el-select__wrapper {
    height: 40px;
  }

  .pageContent {}

  .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }

  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }

  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;
  }

  .avatar {
    width: 178px;
    height: 178px;
    display: block;
  }

  //上传的样式
  .upLoadImg {
    border: 1px dashed #d9d9d9;
    border-radius: 4px;
    text-align: center;
    width: 120px;
    padding: 10px 15px;

    .title {
      font-size: 12px;
      color: #8c939d;
    }

    .addImg {
      width: 40px;
      height: 40px;
    }
  }

  .tipImg {
    margin-left: 20px;
    width: 110px;
    height: 80px;
  }
</style>